import { request } from '@/sheep/request';

const route = {
  path: 'recommend',
  name: 'seller.admin.recommend',
  component: () => import('./index.vue'),
  meta: {
    title: '商品推荐',
  },
};

const api = {
  // 获取商品列表
  list: (data) =>
    request({
      url: 'shop/yb/goods/channelgoods/shopSelectList',
      method: 'POST',
      data,
    }),
  // 获取商品详情
  shopSelectDetails: (goodsId,organId) =>
    request({
      url: `shop/yb/goods/channelgoods/shopSelectDetails/${goodsId}/${organId}`,
      method: 'GET',
    }),
  // 商品分类
  goodsSelect: () =>
    request({
      url: 'shop/admin/category/goodsSelect',
      method: 'GET',
    }),
  // 一键铺货
  addGoods: (organId, goodsId) =>
    request({
      url: `shop/yb/goods/channelgoods/oneClickStocking/${organId}/${goodsId}`,
      method: 'GET',
    }),
  // 铺货记录
  clickStockingRecord: (organId, params) =>
    request({
      url: `shop/yb/goods/channelgoods/clickStockingRecord/${organId}`,
      method: 'GET',
      params,
    }),
	// 解除货源绑定
	noBindGoods: ( data) =>
		request({
		  url: 'shop/yb/goods/channelgoods/noBindGoods',
		  method: 'PUT',
		  data,
		}),

  // 铺货设置
  setting: {
    // 获取我的设置
    detail: () =>
      request({
        url: 'shop/admin/distribution/detail',
        method: 'GET',
      }),
    //   新增配置
    add: (data) =>
      request({
        url: 'shop/admin/distribution/add',
        method: 'POST',
        data,
      }),
    // 编辑配置
    edit: (data) =>
      request({
        url: 'shop/admin/distribution/edit',
        method: 'PUT',
        data,
      }),
	// 运费模板列表
	dispatchList: (params) =>
		request({
			url: 'shop/admin/distribution/dispatchList',
			method: 'GET',
			params,
		}),
  },
  //   收藏记录
  collect: {
    // 收藏列表
    list: (params) =>
      request({
        url: 'shop/admin/collect/list',
        method: 'GET',
        params,
      }),
    //   添加收藏
    add: (data) =>
      request({
        url: 'shop/admin/collect/add',
        method: 'POST',
        data,
      }),
    //   删除收藏
    delete: (id) =>
      request({
        url: `shop/admin/collect/delete/${id}`,
        method: 'DELETE',
      }),
  },
};

export { route, api };
